[fix](job scheduler) Record task finish time on execution failure - #66232
Conversation
Record the finish time when a task enters FAILED through the execution exception path, so MTMV failures expose complete terminal metadata and a usable duration. Key changes: - Set finishTimeMs in AbstractTask.onFail(). - Cover runTask() exception handling in AbstractJobStatusTest. Unit Test: - AbstractJobStatusTest: 13 tests passed.
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
|
Add the PR that introduces the issue to the "related pr" section |
TPC-H: Total hot run time: 29483 ms |
TPC-DS: Total hot run time: 177248 ms |
ClickBench: Total hot run time: 25.2 s |
|
run feut |
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
FE Regression Coverage ReportIncrement line coverage |
|
run p0 |
|
run cloud_p0 |
FE Regression Coverage ReportIncrement line coverage |
FE Regression Coverage ReportIncrement line coverage |
|
/review |
There was a problem hiding this comment.
Review complete: no blocking findings. Approval opinion for 90381bc804de4084ff7fe9f7b3b73ea5019dae3a.
Critical checkpoint conclusions:
- Goal, correctness, and proof: the production change fills the existing
finishTimeMsfield in the no-argument failure path used byAbstractTask.runTask()after an execution exception. The new unit test executes that path and verifiesFAILED, a non-null finish time, and the preserved exception message. - Scope and clarity: the production change is a single focused assignment and aligns
onFail()with the existingonFail(String)andonSuccess()terminal paths. - Concurrency and lifecycle: task execution remains on the existing executor paths, with no new threads, locks, lock ordering, or resource ownership. For MTMV, the timestamp is assigned before the job callback and before
MTMVTask.after()adds the task to persisted history, so FinishTime and DurationMs observe the terminal value. - Parallel paths and compatibility: the message-bearing failure path and success path already record finish time, and the relevant subclass overrides delegate to the base implementation. No configuration, FE/BE protocol, function symbol, storage format, or rolling-upgrade contract changes.
- Error handling, persistence, and observability: the caught exception message remains intact; the existing serialized
ftmfield is populated before MTMV history/edit-log handling, with no new persistence format. This directly repairs the task TVF metadata described by the PR. - Performance: the only runtime cost is one wall-clock read on a failure-only path.
- Test coverage and results: the added JUnit coverage is targeted and deterministic. Current PR checks show FE UT, CheckStyle, COMPILE, and the applicable regression suites passing. I did not run local builds or tests because the authoritative review instructions prohibit builds in this runner.
- Other applicability: there are no transaction/data-visibility, configuration, security, static-initialization, or FE-to-BE variable propagation changes.
- User focus: no additional user-provided review focus was supplied; the complete two-file PR and its upstream/downstream task lifecycle were reviewed.
No inline comments are proposed.
…6232) ### What problem does this PR solve? When a task fails through the execution exception path, `AbstractTask.runTask()` calls the no-argument `onFail()`, which marked the task FAILED without recording `finishTimeMs`. MTMV failed refresh tasks therefore exposed an empty FinishTime and could not calculate DurationMs. relate PR: #27703 ### What changes were made? - Record `finishTimeMs` when `AbstractTask.onFail()` transitions a task to FAILED. - Add a regression unit test covering the `runTask()` exception path and preserving the error message. ### Testing - `AbstractJobStatusTest`: 13 tests passed.
…6232) ### What problem does this PR solve? When a task fails through the execution exception path, `AbstractTask.runTask()` calls the no-argument `onFail()`, which marked the task FAILED without recording `finishTimeMs`. MTMV failed refresh tasks therefore exposed an empty FinishTime and could not calculate DurationMs. relate PR: #27703 ### What changes were made? - Record `finishTimeMs` when `AbstractTask.onFail()` transitions a task to FAILED. - Add a regression unit test covering the `runTask()` exception path and preserving the error message. ### Testing - `AbstractJobStatusTest`: 13 tests passed.
What problem does this PR solve?
When a task fails through the execution exception path,
AbstractTask.runTask()calls the no-argumentonFail(), which marked the task FAILED without recordingfinishTimeMs. MTMV failed refresh tasks therefore exposed an empty FinishTime and could not calculate DurationMs.relate PR: #27703
What changes were made?
finishTimeMswhenAbstractTask.onFail()transitions a task to FAILED.runTask()exception path and preserving the error message.Testing
AbstractJobStatusTest: 13 tests passed.